Skip to content

Conversation

@vaind
Copy link
Collaborator

@vaind vaind commented Oct 8, 2025

Summary

Add support for running custom scripts after dependency updates, enabling additional repository modifications before PR creation.

Changes

  • New input parameter: post-update-script - accepts path to bash (.sh) or PowerShell (.ps1) script
  • Script execution: Scripts receive two arguments:
    • $1 / $args[0] - Original version (before update)
    • $2 / $args[1] - New version (after update)
  • Integration: Post-update logic added to update-dependency.ps1
  • Tests: Comprehensive unit tests covering both script types and error cases
  • Documentation: README updated with usage examples

Use Cases

This feature enables workflows like:

  • Updating lock files after dependency version changes
  • Running code generators that depend on updated dependencies
  • Modifying configuration files that reference dependency versions
  • Applying project-specific transformations

Usage Example

- uses: getsentry/github-workflows/updater@v3
  with:
    path: modules/sentry-cocoa
    name: Cocoa SDK
    post-update-script: scripts/update-lockfile.sh
    api-token: ${{ secrets.CI_DEPLOY_KEY }}

Bash script (scripts/update-lockfile.sh):

#!/usr/bin/env bash
set -euo pipefail

ORIGINAL_VERSION="$1"
NEW_VERSION="$2"

echo "Updated from $ORIGINAL_VERSION to $NEW_VERSION"
# Update lock files or make other changes

Test Plan

  • Unit tests for PowerShell script execution
  • Unit tests for bash script execution
  • Unit tests for error handling (missing script, script failures)
  • Unit tests for empty original version case

🤖 Generated with Claude Code

@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against ff0be35

Add support for running custom scripts after dependency updates to enable
additional repository modifications before PR creation.

Changes:
- Add `post-update-script` input parameter to action.yml
- Update update-dependency.ps1 to accept PostUpdateScript parameter
- Scripts receive original and new version as arguments
- Support both bash (.sh) and PowerShell (.ps1) scripts
- Add comprehensive unit tests for post-update script functionality
- Update README with usage examples for both script types

The post-update script is executed after the dependency is updated but
before the PR is created, allowing users to make additional changes such
as updating lock files, running code generators, or modifying related
configuration files.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@vaind vaind force-pushed the feat/post-update-script branch from 30f0c5f to ff0be35 Compare October 8, 2025 13:14
@vaind vaind merged commit 3182dd4 into main Oct 8, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants